package com.loong.user.controller.forehead;


import com.loong.common.mvc.BaseForeheadController;
import com.loong.common.rest.Result;
import com.loong.user.common.forehead.param.WeChatLoginRequestParam;
import com.loong.user.handler.WeChatLoginHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 微信授权登录控制
 */
@RestController
@RequestMapping("user/weChat")
public class WeChatLoginController extends BaseForeheadController {
    @Resource
    private WeChatLoginHandler weChatLoginHandler;

    /**
     * 微信授权登录
     * @param requestParam
     * @return
     */
    @GetMapping("wxLogin")
    public Result login(WeChatLoginRequestParam requestParam){

        return handlerExecutor.execute(()->weChatLoginHandler.login(requestParam));
    }
}
